package string.nowcoder.easy;

import java.util.Scanner;

/**
 * @author bruin_du
 * @description 收件人列表
 * https://www.nowcoder.com/questionTerminal/5973a31d58234b068fa1fe34f7290855
 * @date 2022/6/2 16:30
 **/
public class RecipientsList {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextLine()){
            int n = in.nextInt();
            String x = in.nextLine();
            String[] strings = new String[n];
            for (int i = 0; i < strings.length; i++) {
                strings[i] = in.nextLine();
            }
            StringBuilder sb = new StringBuilder();
            for (String str : strings) {
                boolean flag = false;
                for (int i = 0; i < str.length(); i++) {
                    if(str.charAt(i) == ' ' || str.charAt(i) == ','){
                        flag = true;
                        break;
                    }
                }
                if(flag){
                    sb.append("\"").append(str).append("\"");
                }else{
                    sb.append(str);
                }
                sb.append(", ");
            }
            sb.setLength(sb.length() - 2);
            System.out.println(sb);
        }
    }
}
